﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<SG.Domain.OrdenCompra>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    

    <table class="table">
        <tr>
            <th></th>
            <th>
                Proveedor
            </th>
            <th>
                NumeroOrden
            </th>
            <th>
                FechaEmision
            </th>
            <th>
                FechaEntrega
            </th>
            <th>
                Estado
            </th>
            <th></th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%: Html.ActionLink("Recibir de Proveedor", "Confirm", new { id = item.Id })%> |
                <%: Html.ActionLink("Confirmar Orden", "Generate", new { id = item.Id })%>
            </td>
            <td>
                <%: item.Proveedor.Nombre %>
            </td>
            <td>
                <%: item.NumeroOrden %>
            </td>
            <td>
                <%: String.Format("{0:g}", item.FechaEmision) %>
            </td>
            <td>
                <%: String.Format("{0:g}", item.FechaEntrega) %>
            </td>
            <td>
                <%: item.Estado %>
            </td>
            <td>
                <%: Html.ActionLink("Detalle", "Details", new { id=item.Id })%> |
                <%: Html.ActionLink("Anular", "Anular", new { id=item.Id })%>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%: Html.ActionLink("Nueva Orden", "Create") %>
    </p>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="TitlePage" runat="server">
</asp:Content>

